/* Copyright (c) 2004-2024 peigen.info. All rights reserved. */

package info.peigen.hotpot.business.account.manage.convertor;

import cn.hutool.core.bean.BeanUtil;
import info.peigen.hotpot.business.account.core.domain.account.AccountFreezeLog;
import info.peigen.hotpot.business.account.core.repository.entity.AccountFreezeLogEntity;
import info.peigen.hotpot.business.account.manage.form.AccountFreezeLogManageCreateForm;
import info.peigen.hotpot.business.account.manage.form.AccountFreezeLogManageEditForm;
import info.peigen.hotpot.business.account.manage.form.AccountFreezeLogManageSearchForm;
import info.peigen.hotpot.business.account.manage.info.AccountFreezeLogManageInfo;
import info.peigen.hotpot.common.core.util.IdUtil;
import lombok.extern.slf4j.Slf4j;

/**
 * <b>(AccountFreezeLogManageConvertor)</b>
 * 管理后台领域对象 "账户冻结解冻记录" 转换器
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2023-08-29
 */
@SuppressWarnings({"unused"})
@Slf4j
public class AccountFreezeLogManageConvertor {
    // ConvertToEntity
    public static AccountFreezeLogEntity convertToEntity(AccountFreezeLog domain) {
        return BeanUtil.copyProperties(domain, AccountFreezeLogEntity.class);
    }

    public static AccountFreezeLogEntity convertToEntity(AccountFreezeLogManageInfo info) {
        return BeanUtil.copyProperties(info, AccountFreezeLogEntity.class);
    }

    public static AccountFreezeLogEntity convertToEntity(AccountFreezeLogManageSearchForm form) {
        return BeanUtil.copyProperties(form, AccountFreezeLogEntity.class);
    }

    public static AccountFreezeLogEntity convertToEntity(AccountFreezeLogManageCreateForm form) {
        if (form.getAccountId() == null) {
            form.setAccountId(IdUtil.id());
        }
        return BeanUtil.copyProperties(form, AccountFreezeLogEntity.class);
    }

    public static AccountFreezeLogEntity convertToEntity(AccountFreezeLogManageEditForm form) {
        return BeanUtil.copyProperties(form, AccountFreezeLogEntity.class);
    }

    // ConvertToDomain
    public static AccountFreezeLog convertToDomain(AccountFreezeLogEntity entity) {
        return BeanUtil.copyProperties(entity, AccountFreezeLog.class);
    }

    public static AccountFreezeLog convertToDomain(AccountFreezeLogManageInfo info) {
        return BeanUtil.copyProperties(info, AccountFreezeLog.class);
    }

    public static AccountFreezeLog convertToDomain(AccountFreezeLogManageSearchForm form) {
        return BeanUtil.copyProperties(form, AccountFreezeLog.class);
    }

    public static AccountFreezeLog convertToDomain(AccountFreezeLogManageCreateForm form) {
        if (form.getAccountId() == null) {
            form.setAccountId(IdUtil.id());
        }
        return BeanUtil.copyProperties(form, AccountFreezeLog.class);
    }

    public static AccountFreezeLog convertToDomain(AccountFreezeLogManageEditForm form) {
        return BeanUtil.copyProperties(form, AccountFreezeLog.class);
    }

    // convertToInfo
    public static AccountFreezeLogManageInfo convertToInfo(AccountFreezeLog domain) {
        return BeanUtil.copyProperties(domain, AccountFreezeLogManageInfo.class);
    }

    public static AccountFreezeLogManageInfo convertToInfo(AccountFreezeLogEntity entity) {
        return BeanUtil.copyProperties(entity, AccountFreezeLogManageInfo.class);
    }

    public static AccountFreezeLogManageInfo convertToInfo(AccountFreezeLogManageSearchForm form) {
        return BeanUtil.copyProperties(form, AccountFreezeLogManageInfo.class);
    }

    public static AccountFreezeLogManageInfo convertToInfo(AccountFreezeLogManageCreateForm form) {
        if (form.getAccountId() == null) {
            form.setAccountId(IdUtil.id());
        }
        return BeanUtil.copyProperties(form, AccountFreezeLogManageInfo.class);
    }

    public static AccountFreezeLogManageInfo convertToInfo(AccountFreezeLogManageEditForm form) {
        return BeanUtil.copyProperties(form, AccountFreezeLogManageInfo.class);
    }
}